#include <stdio.h>
#include <string.h>
int compare(char* version1, char* version2 ) {
    int len1 = strlen(version1);
    int len2 = strlen(version2);
    int h1=0,h2=0;
    long  sum1 = 0,sum2 = 0;
    while(h1<len1||h2<len2){
        while(h1<len1&&version1[h1]!='.'){
            sum1+=sum1*10+(version1[h1++]-'0');
        }
        while(h2<len2&&version2[h2]!='.'){
            sum2+=sum2*10+(version2[h2++]-'0');
        }
        if(sum1>sum2) {
            return 1;
        }
        else if(sum1<sum2) {
            return -1;
        }
          sum1 = 0;
          sum2 = 0;
        h1++;h2++;
    }
    return 0;
}
int main(){
	char a[100],b[100];
	gets(a);
	gets(b);
	int p = compare(a,b);
	printf("%d",p);
	return 0;
}
